package com.usercar.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.usercar.pojo.Content;
import com.usercar.mapper.ContentMapper;
import com.usercar.service.IContentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-08-11
 */
@Service
public class ContentServiceImpl extends ServiceImpl<ContentMapper, Content> implements IContentService {

    @Autowired
    private ContentMapper contentMapper;

    @Override
    public List<Content> selectByFeild(Long field, Date startTime, Date endTime) {
        return contentMapper.selectByFieldAndTime(field,startTime,endTime);
    }

    @Override
    public Content selectByYear(Date time) {
        Content c = contentMapper.selectByTime(time);
        return c;
    }

    @Override
    public void insertInfo(Content content) {
        contentMapper.insert(content);
    }

    @Override
    public Content selectByNowTime(Date d) {
       Content c =  contentMapper.selectByTime(d);
        return c;
    }

    @Override
    public void updateByout_trade_no(String out_trade_no) {
        contentMapper.updateByout_trade_no(out_trade_no);
    }
}
